package com.example.servlet.jiao_test;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "delects", value = "/delects")
public class DelectsServlet extends HttpServlet {
    public void init() {

    }

    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        if (username != null && !"".equals(username)) {

        } else if (password != null && !"".equals(password)) {
            request.setAttribute("mage", "用户名输入错误,请重新输入");
            request.getRequestDispatcher("page/delects.jsp").forward(request, response);
        } else if (password == null) {

        }
    }

    public void destroy() {
    }
}
